#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	int count = 0;
	int n, m, k;
	int arr[100][100];
	int a = 0, b = 0;
	scanf_s("%d%d%d", &n, &m, &k);
	for (int i = 0; i<n; i++)
	{
		for (int j = 0; j<m; j++)
		{
			scanf_s("%d", &arr[i][j]);
			if (arr[i][j] == 1) count++;
		}
	}
	a = count - 2 * k;
	b = 3 * k - count;	
	printf("%d %d", a, b);
	
	return 0;
}